﻿using System;
using System.Collections.Generic;
using System.Linq;


namespace battlenet.wow.rt.domain.objects
{
    public class BnFile
    {
        /// <summary>
        /// Gets or sets the URI.
        /// </summary>
        /// <value>
        /// The URI.
        /// </value>
        public Uri Uri { get; set; }

        /// <summary>
        /// Gets or sets the last modified.
        /// </summary>
        /// <value>
        /// The last modified.
        /// </value>
        public DateTime LastModified { get; set; }

        /// <summary>
        /// Initializes a new instance of the <see cref="BnFile"/> class.
        /// </summary>
        public BnFile() {}

        /// <summary>
        /// Initializes a new instance of the <see cref="BnFile"/> class.
        /// </summary>
        /// <param name="url">The URL.</param>
        /// <param name="lastModified">The last modified.</param>
        public BnFile(string url, DateTime lastModified)
        {
            Uri = new Uri(url);
            LastModified = lastModified;
        }
    }

    public class AuctionHouseFileCollection : List<BnFile>
    {
        public AuctionHouseFileCollection(IEnumerable<BnFile> files)
        {
            var bnFiles = files.ToList();
            if (bnFiles.IsNullOrEmpty()) return;
            AddRange(bnFiles);
        }
    }
}
